package main

import "fmt"

var stack1 = make([]int, 0)
var stack2 = make([]int, 0)
var pos1 = 0
var pos2 = 0

func Push(node int) {
	stack1 = append(stack1[:pos1], node)
	pos1++
}

func Pop() int {
	if pos2 == 0 {
		for pos1 != 0 {
			pos1--
			stack2 = append(stack2[:pos2], stack1[pos1])
			pos2++
		}
	}
	pos2--
	return stack2[pos2]
}

func main() {
	Push(1)
	fmt.Println(Pop())
}
